import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/sys/login',
    method: 'post',
    data
  })
}

export function getUserInfo() {
  return request({
    url: '/sys/user/info',
    method: 'get'
  })
}

export function getMenuList() {
  return request({
    url: '/sys/menu/select',
    method: 'get'
  })
}

export function getMenuInfo(menuId) {
  return request({
    url: '/sys/menu/info/' + menuId,
    method: 'get'
  })
}

export function addMenu(data) {
  return request({
    url: '/sys/menu/save',
    method: 'post',
    data
  })
}

export function updateMenu(data) {
  return request({
    url: '/sys/menu/update',
    method: 'post',
    data
  })
}

export function getMenuAllList() {
  return request({
    url: '/sys/menu/tree',
    method: 'get'
  })
}

export function deleteMenu(menuId) {
  return request({
    url: '/sys/menu/delete/' + menuId,
    method: 'get'
  })
}

